Skip to content

Conversation

dmivankov
Copy link
Contributor

Should fix #1372

cfg = "target",
),
"_java": attr.label(
default = "@bazel_tools//tools/jdk:current_java_runtime",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be pulled from the java runtime toolchain -- @bazel_tools//tools/jdk:runtime_toolchain_type, rather than an attribute.

This is to ensure that the binary will respect platform during compilation. With RBE, it's not unusual to build binaries for a target platform on an incompatible exec. e.g. it ain't always host. :)

Otherwise, looks good.

args = " ".join(args),
srcs = " ".join([src.path for src in ctx.files.srcs]),
binjava = ctx.attr._java[java_common.JavaRuntimeInfo].java_executable_runfiles_path,
binjava = ctx.toolchains["@bazel_tools//tools/jdk:runtime_toolchain_type"].java_runtime.java_executable_runfiles_path,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ktlint_fix doesn't use java toolchain to run its binary
3 participants